---@class AlreadySelectSkillCondition:AbstractCondition
local AlreadySelectSkillCondition = ClientFight.CreateClass("AlreadySelectSkillCondition",ClientFight.AbstractCondition)
---@return EStatus
function AlreadySelectSkillCondition:update()
   SkillRoleMgr.savePathFile( "[" ..self.fight.frame.."][技能判断]" ..self.fighter:print() .."进行技能选择判断")
    --不能使用技能
    if FighterStateEnum.is(self.fighter,FighterStateEnum.CAN_NOT_USE_SKILL) and
            FighterStateEnum.is(self.fighter,FighterStateEnum.CAN_NOT_NORMAL_ATTACK) then
       SkillRoleMgr.savePathFile("["..self.fight.frame .."][技能判断]" ..self.fighter:print() .."不能普通攻击和使用技能");
        self.fighter:setPrepareSkill(nil);
        self.fighter.prepareTarget = nil
        return EStatus.SUCCESS;
    end
    if self.fighter.totalSign.signs[FighterSignEnum.TAG_1000] then
       SkillRoleMgr.savePathFile("[" ..self.fight.frame.."][技能判断]"..self.fighter:print() .."不能主动释放技能");
        self.fighter:setPrepareSkill(nil)
        self.fighter.prepareTarget = nil
        return EStatus.SUCCESS;
    end
    --已经选择过技能
    if self.fighter.prepareSkill then
        --技能不能使用
        if FighterStateEnum.is(self.fighter,FighterStateEnum.CAN_NOT_USE_SKILL) and self.fighter.prepareSkill.skillBean.f_SkillType ~= SkillTypeEnum.NORMAL_ATTACK then
           SkillRoleMgr.savePathFile("[" ..self.fight.frame .."][技能判断]"..self.fighter:print() .."准备使用技能" ..self.fighter.prepareSkill .. "因不能使用而重新选择");
            self.fighter:setPrepareSkill(nil);
            self.fighter.prepareTarget = nil
            return EStatus.FAILURE
        elseif FighterStateEnum.is(self.fighter,FighterStateEnum.CAN_NOT_NORMAL_ATTACK) and self.fighter.prepareSkill.skillBean.f_SkillType == SkillTypeEnum.NORMAL_ATTACK then
           SkillRoleMgr.savePathFile( "[" ..self.fight.frame.."][技能判断]"..self.fighter:print() .."准备使用普通攻击" ..self.fighter.prepareSkill .."因不能使用而重新选择")
            self.fighter:setPrepareSkill(nil);
            self.fighter.prepareTarget = nil
            return EStatus.FAILURE;
            --能量不够
        elseif self.fighter.energy < self.fighter:calUseSp(self.fighter.prepareSkill) then
           SkillRoleMgr.savePathFile("[" .. self.fight.frame .."][技能判断]" ..self.fighter:print() .."准备使用技能" ..self.fighter.prepareSkill.. "因能量不够而重新选择")
            self.fighter:setPrepareSkill(nil)
            self.fighter.prepareTarget = nil
            return EStatus.FAILURE;
        end
       SkillRoleMgr.savePathFile( "[" ..self.fight.frame .. "][技能判断]" ..self.fighter:print() .."已经选择过技能")
        return EStatus.SUCCESS;
    end
    self.fighter:setPrepareSkill(nil)
    self.fighter.prepareTarget = nil
   SkillRoleMgr.savePathFile( "[" ..self.fight.frame .."][技能判断]"..self.fighter:print() .."可以进行技能选择");

    return EStatus.FAILURE;
end